class HttpException extends Error {
  constructor(params = {
    message: '服务器异常',
    errCode: '0',
    status: '500'
  }) {
    super();
    this.message = params.message;
    this.errCode = params.errCode;
    this.status = params.status;
  }
}

class ParameterException extends HttpException {
  constructor(params = {
    message: '',
    errCode: ''
  }) {
    super();
    this.message = params && params.message || '参数错误';
    this.errCode = params && params.errCode || 10000;
    this.status = 400;
  }
}

module.exports = {
  HttpException,
  ParameterException
}